package com.jinboe.document.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 文档定义,定义XML元素的具体属性attribute，text，element
 * @author wangguiwei
 *
 */
public class DocumentDefinition {
	//下面三个属性值作为基础数据字典
	public static String elementTypeName="element";
	public static String textTypeName="text";
	public static String attributeValueTypeName="attributeValue";
		
	private List <String> attributeValues;
	private List <String> textValues;
	private List <String> elements;	
	private static Map <String,String>definitionTypeMap=new HashMap();

	
	public List<String> getAttributeValues() {
		return attributeValues;
	}
	public void setAttributeValues(List<String> attributeValues) {
		this.attributeValues = attributeValues;
		if(attributeValues!=null){
			for(String attribute:attributeValues){
				definitionTypeMap.put(attribute, attributeValueTypeName);
			}
		}
	}
	public List<String> getTexts() {
		return texts;
	}
	public void setTexts(List<String> texts) {
		this.texts = texts;
		if(texts!=null){
			for(String text:texts){
				definitionTypeMap.put(text, textTypeName);
			}
		}
	}
	public List<String> getElements() {
		return elements;
	}
	public void setElements(List<String> elements) {
		this.elements = elements;
		if(elements!=null){
			for(String element:elements){
				definitionTypeMap.put(element, elementTypeName);
			}
		}
	}
	//取得XML元素的具体属性attribute，text，element
	public static String getDefinitionType(String defName){
		return definitionTypeMap.get(defName);
	}
	
}
